<template>
	<view class="container">
		<view class="content">
			<!-- <view class="kongbai"></view> -->
			<view class="liebiao">
				<uni-grid :column="1" :show-border="false"  :square="false" @change="change">
					<uni-grid-item class="leibieliebiao" v-for="(item, index) in yangshiliebiao_data.yangshi_data" :key="index">
						<!-- <image class="ysyimage" :src="item.image" mode="aspectFill" ></image> -->
						<view class="neirongqu"><text class="text">{{item.name}}</text>
						<text class="text">{{ item.content }}</text>
						<button class="text button">使用</button>
						</view>
					</uni-grid-item>
				</uni-grid>
			</view>
			</view>
			<view class="button_anniu" @click="add_yangshi">新增样式</view>
		</view>
	</view>
</template>

<script>
	import uniGrid from "@/components/uni-grid/uni-grid.vue"
	import uniGridItem from "@/components/uni-grid-item/uni-grid-item.vue"
	export default {
	    components: {uniGrid,uniGridItem},
			data() {
				return {
					yangshiliebiao_data:{}
				}
			},
			async onLoad(option){
				this.yangshiliebiao_data = await this.$api.json('yangshiliebiao_data');
				console.log(JSON.stringify(this.yangshiliebiao_data));
			},
			onShow() {
				// let params = {
				// 	"canshu1": this.yangshiliebiao_data.canshu1
				// };
				// upload_data(params, 'GET', this.$api.Apiurl.gongzuotaishouye_urlData.url, (res) => {
				// 	if (res.data.code == 1) {
				// 		this.yangshiliebiao_data = this.$api.Json.yangshiliebiao_data;
				// 	} else {
				// 		msg(res.data.msg);
				// 	}
				// });
			},
			methods:{
				change(e) {
					let {
						index
					} = e.detail
					let link_url = this.yangshiliebiao_data.yangshi_data[index].url;
					uni.navigateTo({
						url:link_url
					})
				},
				add_yangshi(){
					uni.navigateTo({
						url:"/pages/gongzuotai/yangshi/add_yangshi/add_yangshi"
					})
				}
			}
	}
</script>

<style>
	.kongbai{
		background: #EDEDED;
		width: 100%;
		height: 30upx;
	}
	.leibiaofenlei{
		margin-top: 50upx;
	}
	.image_set{
		width: 120upx;
		height: 120upx;
	}
	.text{
		color: #707070;
		font-size: 30upx;
		flex:2;
		text-align: left;
	}
	.ysyimage{
		width: 120upx;
		height: 120upx;
	}
	.leibieliebiao{
		
		border-bottom: 2upx solid #909399;
		height: 100upx;
		line-height: 80upx;
		
	}
	.neirongqu{
		display: flex;
		width: 90%;
	}
	.button{
		background-color: #4CD964;
		color: #FFFFFF;
		flex:1;
		text-align: center;
	}
	.button_anniu{
		position: fixed;
		bottom:0;
		left:0;
		
	}
</style>
